import requests


class Base():
    def __init__(self,url):
        self.url = url
        self.session = requests.session()

    def get(self,url=None,status=None,data=None,headers=None):
        url = f"{self.url}{url}"
        if status == 'json':
            return requests.get(url=url,json=data,headers=headers)
        elif status == 'data':
            return requests.get(url=url,data=data,headers=headers)
        else:
            return requests.get(url=url,params=data,headers=headers)

    def put(self,url=None,status=None,data=None,headers=None):
        url = f"{self.url}{url}"
        if status == 'json':
            return requests.put(url=url,json=data,headers=headers)
        elif status == 'data':
            return requests.put(url=url,data=data,headers=headers)
        else:
            return requests.put(url=url,params=data,headers=headers)

    def post(self,url=None,status=None,data=None,headers=None):
        url = f"{self.url}{url}"
        if status == 'json':
            return requests.post(url=url,json=data,headers=headers)
        elif status == 'data':
            return requests.post(url=url,data=data,headers=headers)
        else:
            return requests.post(url=url,params=data,headers=headers)

    def delete(self,url=None,status=None,data=None,headers=None):
        url = f"{self.url}{url}"
        if status == 'json':
            return requests.delete(url=url,json=data,headers=headers)
        elif status == 'data':
            return requests.delete(url=url,data=data,headers=headers)
        else:
            return requests.delete(url=url,params=data,headers=headers)





